import http from './index'

let getCate = () => {
    //返回http的请求
    return http.get('/getcate')
}

let getcates = () => {
    return http.get('/getcates')
}

let getBanner = () => {
    //返回http的请求
    return http.get('/getbanner')
}
let gethortgoods = () => {
    return http.get('/gethortgoods')
}

//获取模糊搜索
let search = (keywords) => {
    return http.get('/search',{params:{keywords}})
}

let register = (data) => {
    return http.post('/register',data)
}

let login = (data) => {
    return http.post('/login',data)
}

let getgoodsinfo = (id) => {
    return http.get('/getgoodsinfo',{params:{id}})
}

let cartlist = (data) => {
    return http.get('/cartlist',{params:data})
}

let cartadd = (data) => {
    return http.post('/cartadd',data)
}

let cartedit = (data) => {
    return http.post('/cartedit',data)
}
let cartdelete = (id) => {
    return http.post('/cartdelete',{id})
}
let orderadd = () => {
    return http.post('/orderadd')
}

export {
    getCate,
    getcates,
    getBanner,
    gethortgoods,
    search,
    register,
    login,
    getgoodsinfo,
    cartlist,
    cartadd,
    cartedit,
    cartdelete,
    orderadd,
}
